<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('财务运单列表')" />
    <th:block th:include="include :: bootstrap-select-css" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-10 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <!--            <li>-->
                        <!--              <label>提验人：</label>-->
                        <!--              <input type="text" id="vehicleInspector" name="vehicleInspector"/>-->
                        <!--            </li>-->
                        <!--            <li>-->
                        <!--              <label>业务员：</label>-->
                        <!--              <input type="text" id="userName" name="userName"/>-->
                        <!--            </li>-->
                        <li>
                            <label>订单查询：</label>
                            <input type="text" id="vehicleModel" name="vehicleModel"/>
                        </li>
                        <!--            <li>-->
                        <!--              <label>运输结算：</label>-->
                        <!--              <input type="text" id="transporter" name="transporter"/>-->
                        <!--            </li>-->
                        <!--            <li>-->
                        <!--              <label>结算状态：</label>-->
                        <!--              <select id="refund" name="refund">-->
                        <!--                <option value="0">所有</option>-->
                        <!--                <option value="1">有欠返</option>-->
                        <!--                <option value="2">有欠付</option>-->
                        <!--              </select>-->
                        <!--            </li>-->
                        <!--            <li>-->
                        <!--              <label>支付方式：</label>-->
                        <!--              <select name="payType" th:with="type=${@dict.getType('pay_type')}">-->
                        <!--                <option value="">所有</option>-->
                        <!--                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>-->
                        <!--              </select>-->
                        <!--            </li>-->
                        <!--            <li>-->
                        <!--              <label>订单状态：</label>-->
                        <!--              <select name="orderType" th:with="type=${@dict.getType('order_type')}">-->
                        <!--                <option value="">所有</option>-->
                        <!--                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>-->
                        <!--              </select>-->
                        <!--            </li>-->
                        <li class="select-time">
                            <label>操作时间：</label>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="searchPre()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="resetPre()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:finance:export">
                <i class="fa fa-download"></i> 导出数据
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped" style=" white-space: nowrap; overflow: hidden; overflow-x: scroll; -webkit-backface-visibility: hidden; -webkit-overflow-scrolling: touch;">
            <table id="bootstrap-table">
            </table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: bootstrap-select-js" />
<script th:inline="javascript">


    var editFlag = [[${@permission.hasPermi('system:finance:edit')}]];
    var datasPay = [[${@dict.getType('pay_type')}]];
    var datasType = [[${@dict.getType('order_type')}]];

    var prefix = ctx + "system/finance";

    $(function() {
        var options = {
            url: prefix + "/list",
            refundUrl: prefix + "/refund",
            completionUrl: prefix + "/completion",
            updateUrl: prefix + "/edit/{id}",
            exportUrl: prefix + "/export",
            detailUrl: prefix + "/detail/{id}",
            settlementUrl: prefix + "/settlement",
            detailedUrl : prefix + "/detailed/{id}",
            salesmanUrl: prefix + "/salesman/{id}",
            modalName: "收支报表",
            showSearch: false,
            showRefresh: false,
            showToggle: false,
            showColumns: false,
            columns: [
                [
                    {
                        field: 'id',
                        title: '主键',
                        visible: false,
                        valign:"middle",
                        align:"center",
                        colspan: 1,
                        rowspan: 2
                    },
                    {
                        field: 'orderId',
                        title: '主键',
                        visible: false,
                        valign:"middle",
                        align:"center",
                        colspan: 1,
                        rowspan: 2
                    },
                    {
                        field: 'createUser',
                        title: '建单人',
                        valign:"middle",
                        align:"center",
                        colspan: 1,
                        rowspan: 2
                    },
                    {
                        field: 'vehicleInspector',
                        title: '提验人',
                        valign:"middle",
                        align:"center",
                        colspan: 1,
                        rowspan: 2
                    },
                    {
                        field: 'userName',
                        title: '业务员',
                        valign:"middle",
                        align:"center",
                        colspan: 1,
                        rowspan: 2
                    },
                    {
                        field: 'client',
                        title: '委托人',
                        valign:"middle",
                        align:"center",
                        colspan: 1,
                        rowspan: 2
                    },
                    {
                        field: 'clientPhone',
                        title: '委托人电话',
                        valign:"middle",
                        align:"center",
                        colspan: 1,
                        rowspan: 2
                    },
                    {
                        field: 'vehicleModel',
                        title: '车型',
                        valign:"middle",
                        align:"center",
                        colspan: 1,
                        rowspan: 2
                    },
                    {
                        field: 'vin',
                        title: '车架号',
                        valign:"middle",
                        align:"center",
                        colspan: 1,
                        rowspan: 2
                    },
                    {
                        field: 'origin',
                        title: '起始地',
                        valign:"middle",
                        align:"center",
                        colspan: 1,
                        rowspan: 2,
                        formatter: function(value, row, index) {
                            return $.table.tooltip(value, 10);
                        }
                    },
                    {
                        field: 'dest',
                        title: '目的地',
                        valign:"middle",
                        align:"center",
                        colspan: 1,
                        rowspan: 2,
                        formatter: function(value, row, index) {
                            return $.table.tooltip(value, 10);
                        }
                    },
                    {
                        field: 'receiverPhone',
                        align: 'center',
                        title: '接车人电话',
                        valign:"middle",
                        colspan: 1,
                        rowspan: 2
                    },
                    {
                        field: 'freightAmount',
                        align: 'center',
                        title: '运费金额',
                        valign:"middle",
                        colspan: 1,
                        rowspan: 2
                    },
                    {
                        field: 'paidAmount',
                        align: 'center',
                        title: '预付款',
                        valign:"middle",
                        colspan: 1,
                        rowspan: 2
                    },
                    {
                        field: 'payType',
                        title: '支付方式',
                        align: 'center',
                        valign:"middle",
                        colspan: 1,
                        rowspan: 2,
                        formatter: function(value, row, index) {
                            return $.table.selectDictLabel(datasPay, value);
                        }
                    },
                    {
                        field: 'orderType',
                        title: '订单状态',
                        align: 'center',
                        valign:"middle",
                        colspan: 1,
                        rowspan: 2,
                        formatter: function(value, row, index) {
                            return $.table.selectDictLabel(datasType, value);
                        }
                    },
                    {
                        field: 'createTime', align: 'center', title: '建单日期', valign:"middle", colspan: 1, rowspan: 2,
                        formatter: function(value, row, index) {
                            return $.table.tooltip(value, 13);
                        }
                    },
                    { title: "收支明细", valign: "middle", align:"center", colspan: 7, rowspan: 1 },
                    { field: 'profit', title: '收入', valign:"middle", align:"center", colspan: 1, rowspan: 2 },
                    { field: 'commission', title: '支出', valign:"middle", align:"center", colspan: 1, rowspan: 2 },
                    { field: 'updateTime', title: '操作日期', valign:"middle", align:"center", colspan: 1, rowspan: 2 },
                ],
                [
                    {
                        field: 'id',
                        title: '杂费明细',
                        align : 'center',
                        valign : 'middle'
                    },
                    {
                        field: 'id',
                        title: '中介费',
                        align : 'center',
                        valign : 'middle',
                    },
                    {
                        field: 'id',
                        title: '提验费',
                        align : 'center',
                        valign : 'middle',
                    },
                    {
                        field: 'id',
                        title: '其他费',
                        align : 'center',
                        valign : 'middle',
                    },
                    {
                        field: 'id',
                        title: '到收',
                        align : 'center',
                        valign : 'middle',
                    },
                    {
                        field: 'id',
                        title: '中转费',
                        align : 'center',
                        valign : 'middle',
                    },
                    {
                        field: 'id',
                        title: '欠/返',
                        align : 'center',
                        valign : 'middle',
                    },
                ]
            ]
        };
        $.table.init(options);
    });



    function searchPre() {
        totalA();
        $.table.search("formId");
    }

    function resetPre() {
        resetDate();
        totalA();
    }
</script>
</body>
</html>